<{include file="public/header.html"}> 
	<header class="bj-white search-page follow-head">
            <a href="javascript:;" onclick="javascript:history.back(-1);" class="icon-return iconfont iconfont-top iconfont-left col-red"></a>
			<h1 class="bar-title">搜索结果</h1>
	</header>
    <div class="has-result">
        <div class="search-result mt50"><h3>有关“<span class="col-red search-tag"><{$keyword}></span>”的所有描述</h3></div>
        <input type="hidden" class="search-box search-text" value="<{$keyword}>" data-search-val="<{$keyword}>">
        <section class="index-wraper">
            <div class="recommend-article" id="content-list">
                <{foreach from=$list item=val}>
                <section id="list-<{$val['article_id']}>" data-id="<{$val['article_id']}>">
                    <a href="<{$val['detail_url']}>" class="article-box f-cb">
                        <div class="pic fl">
                            <img src="<{$val['thumb']}>" alt="<{$val['title']}>">
                        </div>
                        <div class="article-detail">
                            <p class="title"><{$val['title']}></p>
                            <p class="state f-cb">
                                <font class="iconfont fl">&#xe675;</font><span class="fl mr8"><{$val['commentnum']}></span><font class="iconfont fl mr3">&#xe60a;</font><span class="fl"><{$val['readnum']}></span>
                                <i class="fr">
                                    <img src="<{$val['head_img']}>" class="mr3" alt="<{$val['nickname']}>">
                                    <span><{$val['nickname']}></span>
                                </i>
                            </p>
                        </div>
                    </a>
                </section>
                <{/foreach}>
            </div>
            <div class="loading" id="noresults" <{if $list}> style="display: none;"<{/if}>>
                <a href="javascript:;" class="load-success empty-load">
                    <img src="<{$style_dir}>/img/none/none3.jpg">
                    <p>好东西被妖怪抓走了</p>
                    <p class="col-greyccc mt5">换个关键词试试</p>
                </a>
            </div>
            <div class="loading" id="loading"  style="display: none;">
                <a class="/*pull-load*/ load-success" href="javascript:;">加载中...</a>
            </div>
            <div class="loading" id="nomoreresults" style="display: none;">
                <a href="javascript:;" class="load-success nomore-load">已经到底啦~~~</a>
            </div>
        </section>
    </div>
    <{include file="public/footer_banner.html"}> 
    <script type="text/javascript" src="/static/js/scrollpagination.js"></script>
    <script type="text/javascript">
        $(function(){
            var currentPage = 0;
            $('#content-list').scrollPagination({
                'contentPage': "/ajax/ajax_search_more_art_json",
                'contentData': {
                    'keyWord': $(".search-text").attr("data-search-val"),
                    'pageIndex': currentPage
                },
                'scrollTarget': $(window),
                'heightOffset': 0,
                'beforeLoad': function() { // before load function, you can display a preloader div
                    $('#loading').fadeIn('fast');
                    $('#loading').attr('scrollpagination','disabled');
                },
                'afterLoad': function(elementsLoaded) { // after loading content, you can use this function to animate your new elements
                    $('#loading').fadeOut('fast');
                    $('#loading').attr('scrollpagination','enabled');                           
                    if (elementsLoaded.length == 0) {
                        $('#nomoreresults').fadeIn('slow');
                        $('#content-list').stopScrollPagination();
                    }else{
                        currentPage = currentPage + 1;
                    }
                    if($('#content-list').children().length == 0){
                        $('#nomoreresults').hide();
                    }
                    this.contentData.pageIndex = currentPage;
                    $(elementsLoaded).fadeInWithDelay();
                    if ($('#content-list').children().length > 100) { // if more than 100 results already loaded, then stop pagination (only for testing)
                        $('#nomoreresults').fadeIn();
                        $('#content-list').stopScrollPagination();
                    };
                }
            });     
            $.fn.fadeInWithDelay = function() {
                var delay = 0;
                return this.each(function() {
                    $(this).delay(delay).animate({
                        opacity: 1
                    }, 200);
                    delay += 100;
                });
            }; 
        });
    </script>
<{include file="public/footer.html"}> 